function getWidth(){
	//if (this.webkit419) return this.innerWidth;
	//if (this.opera) return document.body.clientWidth;
	return document.documentElement.clientWidth;
}
_jsc.widget = _jsc.widget || {};
_jsc.widget.tips = function(t, w, h, instance_name){
	this.target_ele = t;
	this.w = w;
	this.h = h;
	var _container = document.createElement('div');
	_container.style.border = "2px solid #C6DFF9";
	_container.style.lineHeight = "160%";
	_container.style.padding = "10px";
	_container.style.display = 'none';
	_container.style.position = 'absolute';
	_container.style.backgroundColor = '#fff';
	_container.style.width = w + 'px';
	_container.style.height = h + 'px';
	this.instance_name = instance_name;
	this.container = document.body.appendChild(_container);
	var _this = this;
	
	t.onmouseover = function(){
		try{
			eval(_this.instance_name + '.show()');
		}catch(e){}
	};
	
	t.onmouseout = function(){
		try{
			eval(_this.instance_name + '.hide()');
		}catch(e){}
	};
	
	this.show = function(){
		_this.container.innerHTML = _this.target_ele.getAttribute('tips');
		_this.container.style.display = '';
		_this.container.style.textAlign = 'left';
		var _left = _jsc.pos.getX(_this.target_ele);
		var _cw = getWidth();
		// 2007-10-30
		if(_cw - _left - _this.target_ele.offsetWidth <= parseInt(_this.w)){
			_this.container.style.left = (_left - _this.w - 25) + 'px';
		}else{
			_this.container.style.left = (_left + _this.target_ele.offsetWidth + 5) + 'px';
		}
		_this.container.style.top = _jsc.pos.getY(_this.target_ele) + 'px';
	};
	
	this.hide = function(){
		_this.container.style.display = 'none';
	};
};